package cn.doitedu.rtmk.mgmt.doit39_rtmk_management.controller;

import cn.doitedu.rtmk.mgmt.doit39_rtmk_management.pojo.LoginBean;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Slf4j
@Controller
public class PageController {

    @RequestMapping("/")
    public String getIndex(){
        return "home";
    }

    @RequestMapping("/bbb")
    public String bbb(String a){
        System.out.println(a);
        return "bbb";
    }

    @RequestMapping("/aaa")
    public String aaa(String a){
        System.out.println(a);
        return "aaa";
    }

    @RequestMapping("/login")
    public String userLogin(LoginBean loginBean){
        log.warn("收到登录请求,name:{} ,password:{}",loginBean.getUser(),loginBean.getPassword());

        if(loginBean.getUser().equals("zhangsan") && loginBean.getPassword().equals("123456")) {
            return "bbb";
        }else{
            return "aaa";
        }

    }
}
